using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

public class NotificationItem : GenericDialog
{
	public DialogNotifications dialogNotifications;

	public NotificationsManager.NotificationName notificationName;

	public Button buttonSelf;

	public Image iconMain;

	public Text labelTitle;

	public Text labelDescription;

	public Image iconQuantity;

	public Text labelQuantity;

	private Tweener tweenMove;

	public void UpdateQuantity()
	{
		int notificationReward = Economy.GetNotificationReward(notificationName);
		labelQuantity.text = "+" + notificationReward;
	}

	public void MoveToPosition(Vector2 position, float delay = 0f)
	{
		if (tweenMove != null)
		{
			tweenMove.Kill();
			tweenMove = null;
		}
		if (base.rectTransform.anchoredPosition != position)
		{
			tweenMove = base.rectTransform.DOAnchorPos(position, 0.2f, true).SetEase(Ease.OutSine).SetDelay(delay);
		}
		else
		{
			Debug.Log("move not needed " + base.name);
		}
	}
}
